//const {calculateMD5} = require("bindings")("md5addon")
//console.log(calculateMD5("abcdef"));
// console.log(addon.GetPosition());
const {readFile} = require("fs");
const addon = require("bindings")("safeThread")//getPosition
// addon.GetPosition().then(result=>{
//     console.log(result);
// }).catch(err=>{
//     console.log('error:==>',err);
// })
readFile("E:/mp4/001.png", async (err, data) => {
    if(err){
        return console.error(err);
    }
    try{ 
        const success = await addon.startProcessing(data)
        if (success) {
            console.log('js main thread:===>','Processing succeeded!');
        } else {
            console.log('js main thread:===>','Processing failed!');
        }
    }catch(error){
        console.error('js main thread:===>','Error occurred:', error);
    }
})
// console.log(buffer);